package com.jy.servlet;

import com.alibaba.fastjson.JSON;
import com.jy.bean.Lndividual_orders;
import com.jy.bean.Order_browse;
import com.jy.service.Orderservice;
import com.jy.service.impl.OrderSericelmpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

public class orderDataMerchandiseServlet extends HttpServlet {
    private Orderservice orderservice;
    private static final Logger log = LoggerFactory.getLogger(orderListServlet.class);

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String ordernumber = request.getParameter("orderList_ordernumber");

        orderservice = new OrderSericelmpl();

        List<Lndividual_orders> loList = orderservice.selectByOrdernumber(ordernumber);

        String data = JSON.toJSONString(loList);

        response.setContentType("application/json");
        response.setCharacterEncoding("utf-8");
        PrintWriter out = response.getWriter();
        out.println(data);
        log.debug("data:" +data);
    }
}
